by Van Den Driessche Fran?ois (2 Submissions)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 14th April 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Cleaning a string from " ',-.()!_$*<>/\?;:=+"
Dim nLength As Integer
Dim nStart As Integer
Dim sOne As String
Dim sNoWay As String
'
sNoWay = " ',-.()!_$*<>/\?;:=+" 'The first one is a space.
'Feel free to put or get other
'literals in or out the NoWay's
'string.
If Not IsNull(sString) Then
nLength = Len(sString)
nStart = 1
Do While nStart <= nLength
sOne = Mid(sString, nStart, 1)
If InStr(1, sNoWay, sOne, vbTextCompare) = 0 Then
Clean = Clean & sOne
End If
nStart = nStart + 1
Loop
End If
End Function